package com.vhall.component.dao.exam;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vhall.component.entity.exam.ExamAnswerEntity;
import com.vhall.component.entity.exam.dto.ExamAnswersDTO;
import com.vhall.component.entity.exam.dto.ExamStatDTO;
import com.vhall.component.entity.exam.vo.AnsweredExamResVo;
import com.vhall.component.entity.exam.vo.ExamAnswerListVo;
import com.vhall.component.entity.exam.vo.ExamGradeListReqVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author song.dong
 * @date 2021-07-12 14:43
 */
@Mapper
@Repository
public interface ExamAnswersMapper extends BaseMapper<ExamAnswerEntity> {

    /**
     * @param vo
     * @return
     */
    List<ExamAnswerEntity> selectExamAnswers(@Param("vo") ExamGradeListReqVo vo);


    /**
     * @param examId
     * @return
     */
    ExamStatDTO selectRaw(@Param("examId") Integer examId);

    /**
     * @param vo
     * @return
     */
    List<ExamAnswersDTO> joinRoomJoinsList(@Param("vo") ExamAnswerListVo vo);

    IPage<ExamAnswersDTO> joinRoomJoinsPage(@Param("page") Page page, @Param("vo") ExamAnswerListVo vo);

    IPage<AnsweredExamResVo> selectAnsweredExam(Page page, @Param("roomId") String roomId, @Param("accountId") Integer accountId, @Param("keyword") String keyword);
}
